package com.fl.util;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class ContentUtil {

	/**
	 * This method returns a string from the demo's resource bundle.
	 * 
	 * @param key
	 *            the key
	 * @return the string
	 */
	public static String getString(String key) {
		String value = null;
		try {
			value = getResourceBundle().getString(key);
		} catch (MissingResourceException e) {
			System.out
					.println("java.util.MissingResourceException: Couldn't find value for: "
							+ key);
		}
		if (value == null) {
			value = "Could not find resource: " + key + "  ";
		}
		return value;
	}
	
	/**
	 * Returns the resource bundle associated with this demo. Used to get
	 * accessable and internationalized strings.
	 * 
	 * @return the resource bundle
	 */
	private static ResourceBundle getResourceBundle() {
		return ResourceBundle.getBundle("resources.swingset");
	}
}
